import time

from selenium import webdriver
from selenium.webdriver.common.by import By

driver = webdriver.Chrome()
# 2.输入访问地址
driver.get("http://121.43.169.97:8848/pageA.html")

# 1.绝对路径定位
# driver.find_element(By.XPATH,"/html/body/div/fieldset/form/p[1]/input").send_keys("admin")
# 2.相对路径定位
# driver.find_element(By.XPATH,"//p[1]/input").send_keys("admin")
driver.find_element(By.XPATH, "//input[@name='userA']").send_keys("admin")
driver.find_element(By.XPATH, ".//*[@id='passwordA']").send_keys("123456")
# 属性定位：建议选择具有唯一性的属性
# 属性和逻辑结合
driver.find_element(By.XPATH,"//input[@type='button' and @value='prompt']").click()

# driver.maximize_window()
# time.sleep(10)